package com.micro.frog.acct.enums;

import lombok.Getter;

/**
 * 用户类型
 *
 * @author :  ljh
 * @date : 2018/4/15
 **/
public enum UserTypeEnum {

    SUPER_ADMIN(0, "超级管理员"),
    NORMAL_ADMIN(1, "管理员"),
    BUSINESS_ADMIN(2, "运营管理员");
    @Getter
    private Integer code;
    @Getter
    private String value;

    UserTypeEnum(Integer code, String value) {
        this.code = code;
        this.value = value;
    }

    public static String getValueByCode(Integer code) {
        String value = "";
        for (UserTypeEnum anEnum : UserTypeEnum.values()) {
            if (anEnum.getCode().equals(code)) {
                value = anEnum.getValue();
                break;
            }
        }
        return value;
    }
}
